<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
	uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
	uri="https://ajax4jsf.dev.java.net/ajax" prefix="ajax"%><%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<div class="mainBackground">
	<div class="innerBackground">
<f:view locale="#{visitInfo.currentUser.locale}">
	<f:loadBundle basename="resources.VisionClickResources" var="msg"/>
	<jsp:include page="nav.jsp"/>
		<div class="table">
			<div class="tableHead"><h:outputText value="#{msg.ExistRule}"/></div>
			<ajax:repeat value="#{taskRuleBean.projectTaskRule}" var="rule">
				<h:form>
				<h:panelGrid columns="2" border="0">
					<h:outputText value="#{rule.desc}"></h:outputText>
					<h:commandLink value="删除规则" action="#{taskRuleBean.deleteRule}">
						<f:param name="ruleId" value="#{rule.taskRuleId}"/>
					</h:commandLink>
				</h:panelGrid>
				</h:form>		
			</ajax:repeat>
		</div>
		<div class="table">
			<div class="tableHead"><h:outputText value="#{msg.CreateRule}"/></div>
			<h:form>
			<h:panelGrid columns="4" border="0">
				<h:outputText value="#{msg.InputMax}"/>
				<h:inputText value="#{taskRuleBean.max}"></h:inputText>
				<h:selectOneMenu valueChangeListener="#{taskRuleBean.changeType}" immediate="true">
					<f:selectItem itemLabel="#{msg.LimitMaxNum}" itemValue="0"></f:selectItem>
					<f:selectItem itemLabel="#{msg.LimitMinRank}[0-2]" itemValue="1"></f:selectItem>
				</h:selectOneMenu>
				<h:commandLink value="#{msg.CreateImmediate}" action="#{taskRuleBean.addRule}">
				</h:commandLink>
			</h:panelGrid>
			</h:form>
		</div>
</f:view>
</div>
</div>
</body>
</html>